<!--- ========================================================================== --->
<!--- All insert/update are done here                                            --->
<!--- by Maan 12062007 (part of Group Approval eTask application)                --->
<!--- ========================================================================== --->
<SCRIPT LANGUAGE="JAVASCRIPT">
	function funcBack(){
		<CFOUTPUT>
			<CFMODULE TEMPLATE="#client.common_path#cfm_geturlvariables.cfm" REMOVEURL="EDIT,VIEW,DOCNUMBER,RETURNED,ROUTEID,EMPLOYEEID,VIEWDTL">
			<CFSET sUrlVars = urlVariables>
			location.href = "#getFileFromPath(getBaseTemplatePath())#?#sUrlVars#";
		</CFOUTPUT>
	}
	function funcRefresh(){
		<CFOUTPUT>
			<CFMODULE TEMPLATE="#client.common_path#cfm_geturlvariables.cfm" REMOVEURL="ROUTEID,VIEWDTL">
			<CFSET sUrlVars = urlVariables>
			location.href = "#getFileFromPath(getBaseTemplatePath())#?#sUrlVars#";
		</CFOUTPUT>
	}
	function ShowLookup(level, tblname, frmfldcode, formname, fld2disp, fldcode, frmflddesc, flddesc, fldFilter, fldVal) {
		<CFOUTPUT>
			open("#client.common_path#poplookup.cfm" +
		</CFOUTPUT>
			"?tl=" + level +
			"&tn=" + tblname +
			"&fn=" + frmfldcode +
			"&frm=" + formname +
			"&fldprop=" + fld2disp +
			"&fldfn=" + fldcode +
			"&desc=" + frmflddesc +
			"&flddesc=" + flddesc +
			"&fldFilter=" + fldFilter +
			"&fldVal=" + fldVal,
			"LookupWindow", "width=660,height=330,ScrollBars=Yes,Resizable=Yes")
	}
</SCRIPT>
<CFSET isRequired = "false">
<CFSET isReadonly = "true">
<CFIF isDefined("url.view") AND isDefined("url.employeeid")>
	<CFSET isDisable = "READONLY">
	<CFSET btnDisable = "">
	<CFSET sAction = "Editing">
<CFELSEIF isDefined("url.view") AND NOT isDefined("url.employeeid")>
	<CFSET isDisable = "READONLY">
	<CFSET btnDisable = "DISABLED">
	<CFSET sAction = "Viewing">
<CFELSE>
	<CFSET isDisable = "">
	<CFSET btnDisable = "">
	<CFSET sAction = "Editing">
</CFIF>
<CFQUERY NAME="GetFields" DATASOURCE="#client.global_dsn#">
	SELECT COLUMNNAME, COLUMNDESC, COLUMNTYPE, COLUMNREQUIRED, SAMEROW, ISVISIBLEEFORM, ISEDITABLEEFORM, DEFAULTVALUE, HINT, DISPLAYWIDTH, PHYSICALWIDTH, PICKLIST, DISPLAYFORMAT
	FROM GRGBOSETABLEFIELDS
	WHERE TABLENAME = '#GetData.TABLENAME_FK#' AND ISVISIBLEEFORM = 'Y'
	ORDER BY COLUMNORDER ASC
</CFQUERY>
<CFIF isDefined("form.btnAdd")>
	<CFTRY>
		<CFQUERY NAME="checkMasterExist" DATASOURCE="#client.company_dsn#">
			SELECT * FROM ECINBATCHAPPLY 
			WHERE
				(BATCHID = '#GetForm.FORMCODE#') AND
				(DOCNUMBER = '#form.edtBatchNumber#')
		</CFQUERY>
		<CFIF form.btnAdd EQ "Add Application"><!--- Add new --->
			<CFIF checkMasterExist.RECORDCOUNT EQ 0>
				<CFQUERY NAME="insert2Master" DATASOURCE="#client.company_dsn#">
					INSERT INTO ECINBATCHAPPLY (BATCHID, DOCNUMBER, DESCRIPTION, ROUTED, RECCREATEDBY, RECDATECREATED, USERID, DATELASTUPDATE, TIMELASTUPDATE) 
					VALUES
						('#GetForm.FORMCODE#', 
						'#form.edtBatchNumber#', 
						'#form.edtBatchDesc#', 
						'N',
						'#client.userid#',
						'#DateFormat(Now(),"mm/dd/yyyy")#',
						'#client.userid#',
						'#DateFormat(Now(),"mm/dd/yyyy")#',
						'#TimeFormat(Now(),"HH:mm:ss")#')
				</CFQUERY>
			<CFELSE>
				<CFSET sWarn = "Description " & form.edtBatchDesc & "already exists.">
			</CFIF>
		<CFELSEIF form.btnAdd EQ "Update Application"><!--- Update existing --->
			<CFQUERY NAME="checkMaster" DATASOURCE="#client.company_dsn#">
				SELECT * FROM ECINBATCHAPPLY 
				WHERE
					(BATCHID = '#GetForm.FORMCODE#') AND
					(DESCRIPTION = '#form.edtBatchDesc#') AND
					(DOCNUMBER <> '#form.edtBatchNumber#')
			</CFQUERY>
			<CFIF checkMaster.RECORDCOUNT EQ 0>
				<CFQUERY NAME="update2Master" DATASOURCE="#client.company_dsn#">
					UPDATE ECINBATCHAPPLY 
					SET
						DESCRIPTION = '#form.edtBatchDesc#',
						USERID = '#client.userid#',
						DATELASTUPDATE = '#DateFormat(Now(),"mm/dd/yyyy")#',
						TIMELASTUPDATE = '#TimeFormat(Now(),"HH:mm:ss")#'
					WHERE (BATCHID = '#GetForm.FORMCODE#') AND (DOCNUMBER = '#form.edtBatchNumber#')
				</CFQUERY>
			<CFELSE>
				<CFSET sWarn = "Description " & form.edtBatchDesc & "already exists.">
			</CFIF>
		</CFIF>
		<CFTRANSACTION ACTION="COMMIT"/>
		<CFCATCH TYPE="Database">
			<CFSET sWarn = "#CFCATCH.MESSAGE#" & "<BR>" & "#CFCATCH.DETAIL#">
			<CFTRANSACTION ACTION="ROLLBACK"/>
		</CFCATCH>
	</CFTRY>
	<CFSET sMess = "Record successfully saved.">
</CFIF>
<CFIF isDefined("form.btnAddEmps") AND isDefined("form.chkEmp")>
	<CFTRY>
		<!--- check if records is saved --->
		<CFQUERY NAME="chkMaster" DATASOURCE="#client.company_dsn#">
			SELECT * FROM ECINBATCHAPPLY
			WHERE (BATCHID='#GetForm.FORMCODE#') AND (DOCNUMBER = '#form.hidDocnumber#')
		</CFQUERY>
		<CFIF NOT chkMaster.RECORDCOUNT>
			<CFQUERY NAME="insert2Master" DATASOURCE="#client.company_dsn#">
				INSERT INTO ECINBATCHAPPLY (BATCHID, DOCNUMBER, DESCRIPTION, ROUTED, RECCREATEDBY, RECDATECREATED, USERID, DATELASTUPDATE, TIMELASTUPDATE) 
				VALUES
					('#GetForm.FORMCODE#', 
					'#form.hidDocnumber#', 
					'#form.hidBatchDesc#', 
					'N',
					'#client.userid#',
					'#DateFormat(Now(),"mm/dd/yyyy")#',
					'#client.userid#',
					'#DateFormat(Now(),"mm/dd/yyyy")#',
					'#TimeFormat(Now(),"HH:mm:ss")#')
			</CFQUERY>
		</CFIF>
		<CFLOOP INDEX="sPID" LIST="#form.chkEmp#">
			<CFQUERY NAME="insertToEmps" DATASOURCE="#client.company_dsn#">
				INSERT INTO ECINBATCHEMPS (BATCHID, DOCNUMBER, PERSONNELIDNO, DESCRIPTION, RECCREATEDBY, RECDATECREATED, USERID, DATELASTUPDATE, TIMELASTUPDATE)
				VALUES
					('#GetForm.FORMCODE#',
					 '#ListGetAt(sPID,2,"~")#',
					 '#ListGetAt(sPID,1,"~")#',
					 '#form.hidBatchDesc#',
					 '#client.userid#',
					 '#DateFormat(Now(),"mm/dd/yyyy")#',
					 '#client.userid#',
					 '#DateFormat(Now(),"mm/dd/yyyy")#',
					 '#TimeFormat(Now(),"HH:mm:ss")#')
			</CFQUERY>
		</CFLOOP>
		<CFTRANSACTION ACTION="COMMIT"/>
		<CFCATCH TYPE="Database">
			<CFSET sWarn = "#CFCATCH.MESSAGE#" & "<BR>" & "#CFCATCH.DETAIL#">
			<CFTRANSACTION ACTION="ROLLBACK"/>
		</CFCATCH>
	</CFTRY>
	<CFSET sMess = "Employee(s) successfully added.">
</CFIF>
<CFIF isDefined("form.btnDeleteEmployee") AND isDefined("form.chkEmps") AND form.chkEmps NEQ ""><!--- Delete Selected --->
	<CFLOOP LIST="#form.chkEmps#" INDEX="i">
		<CFTRY>
			<CFQUERY NAME="deleteEmps" DATASOURCE="#client.company_dsn#">
				DELETE FROM ECINBATCHEMPS
				WHERE	(BATCHID = '#GetData.BATCHID#') AND 
					(PERSONNELIDNO = '#i#') AND
					<CFIF isDefined("url.docnumber")>(DOCNUMBER = '#url.docnumber#')
					<CFELSEIF isDefined("form.hidDocnumber")>(DOCNUMBER = '#form.hidDocnumber#')
					<CFELSEIF isDefined("form.edtBatchnumber")>(DOCNUMBER = '#form.edtBatchnumber#')</CFIF>
			</CFQUERY>
			<CFQUERY NAME="deleteDtl" DATASOURCE="#client.company_dsn#">
				DELETE FROM ECINBATCHDTL
				WHERE	(BATCHID =
						(SELECT DISTINCT (A.BATCHID)
						FROM ECINBATCHDTL A, ECINBATCHEMPS B
						WHERE A.BATCHID = B.BATCHID AND (A.BATCHID = '#GetData.BATCHID#') AND 
						<CFIF isDefined("url.docnumber")>(A.DOCNUMBER = '#url.docnumber#')
						<CFELSEIF isDefined("form.hidDocnumber")>(A.DOCNUMBER = '#form.hidDocnumber#')
						<CFELSEIF isDefined("form.edtBatchnumber")>(A.DOCNUMBER = '#form.edtBatchnumber#')</CFIF>
							GROUP BY A.BATCHID)) 
					AND (PERSONNELIDNO = '#i#')
			</CFQUERY>
			<CFTRANSACTION ACTION="COMMIT"/>
			<CFCATCH TYPE="Database">
				<CFSET sWarn = "#CFCATCH.MESSAGE#" & "<BR>" & "#CFCATCH.DETAIL#">
				<CFTRANSACTION ACTION="ROLLBACK"/>
			</CFCATCH>
		</CFTRY>
	</CFLOOP>
	<CFSET sMess = "Record(s) successfully deleted.">
</CFIF>
<CFQUERY NAME="checkDtl" DATASOURCE="#client.company_dsn#">
	SELECT A.* FROM ECINBATCHDTL A, ECINBATCHEMPS B
	WHERE 	(A.BATCHID = B.BATCHID) AND 
		(A.BATCHID = '#GetData.BATCHID#') AND
		(A.DOCNUMBER = B.DOCNUMBER) AND
		<CFIF isDefined("url.docnumber")>(B.DOCNUMBER = '#url.docnumber#')
		<CFELSEIF isDefined("form.hidDocnumber")>(B.DOCNUMBER = '#form.hidDocnumber#')
		<CFELSEIF isDefined("form.edtBatchnumber")>(B.DOCNUMBER = '#form.edtBatchnumber#')</CFIF>
</CFQUERY>
<CFIF (isDefined("form.btnAddToRecord") AND isDefined("form.chkEmps") AND form.chkEmps NEQ "")>
	<CFQUERY NAME="autogen" DATASOURCE="#client.global_dsn#">
		SELECT FIELDNAME, SEEDKEY, CODELENGTH, WITHDATE FROM GSTAUTOGENFIELD
		WHERE TABLENAME = '#GetData.TABLENAME_FK#'
	</CFQUERY>	
	<cfset myne = "">
	<CFSET sRefID = "">
	<!--- LOOP DATES STARTS HERE --->
	<CFIF TRIM(GetData.FLDDATES) NEQ "">
		<CFIF (Trim(form.docRangeEnd) EQ "") OR (Trim(form.docRangeStart) EQ "")>
			<CFSET sWarn = "An error was encountered, please check your date range.<br>">
		<CFELSEIF DateCompare("#form.docRangeEnd#","#form.docRangeStart#") GTE 0 AND (form.docRangeStart NEQ "") AND (form.docRangeEnd NEQ "")>
			<CFLOOP LIST="#form.chkEmps#" INDEX="i">
				<CFSET theDate=DATEFORMAT(form.docRangeStart,"mm/dd/yyyy")>
				<CFSET DaysCount = DateDiff("d", "#form.docRangeStart#", "#form.docRangeEnd#") + 1>
				<CFQUERY NAME="checkExist" DATASOURCE="#client.company_dsn#">
					SELECT A.* FROM ECINBATCHDTL A, ECINBATCHEMPS B
					WHERE 	(A.BATCHID = B.BATCHID) AND 
						(A.BATCHID = '#GetData.BATCHID#') AND
						(A.DOCNUMBER = B.DOCNUMBER) AND
						<CFIF isDefined("url.docnumber")>(A.DOCNUMBER = '#url.docnumber#')
						<CFELSEIF isDefined("form.hidDocnumber")>(A.DOCNUMBER = '#form.hidDocnumber#')
						<CFELSEIF isDefined("form.edtBatchnumber")>(A.DOCNUMBER = '#form.edtBatchnumber#')</CFIF> AND 
						(A.PERSONNELIDNO IN ('#i#'))
				</CFQUERY>
				<CFLOOP INDEX="noofdays" FROM="1" TO="#DaysCount#" STEP="1">
					<cfset myne = myne & " " & theDate & "~" & i>
					<CFSET sRefID = CreateUUID()>
					<CFLOOP QUERY="GetFields">
						<CFIF checkExist.RECORDCOUNT NEQ 0>
							<CFSET sFrmField = "form.edt" & GetFields.COLUMNNAME>
							<CFTRY>
								<CFIF NOT isDefined("#sFrmField#")><!--- field does not exist in form, check if autogen or date range--->
									<CFQUERY NAME="autogen" DATASOURCE="#client.global_dsn#">
										SELECT FIELDNAME, SEEDKEY, CODELENGTH, WITHDATE FROM GSTAUTOGENFIELD
										WHERE TABLENAME = '#GetData.TABLENAME_FK#' AND FIELDNAME = '#COLUMNNAME#'
									</CFQUERY>	
									<CFIF COLUMNNAME EQ "PERSONNELIDNO" OR COLUMNNAME EQ "PERSONNELBADGENO">
										<CFSET sFldValue=i>
									<CFELSEIF autogen.RECORDCOUNT>
										<CFQUERY NAME="qryDTL" DATASOURCE="#client.company_dsn#">
											SELECT COLUMNNAME, FIELDVALUE FROM ECINBATCHDTL
											WHERE (BATCHID =
													(SELECT DISTINCT (A.BATCHID)
													FROM ECINBATCHDTL A, ECINBATCHEMPS B
													WHERE A.BATCHID = B.BATCHID AND (A.BATCHID = '#GetData.BATCHID#') AND 
														(A.PERSONNELIDNO = '#i#') AND 
														<CFIF isDefined("url.docnumber")>(B.DOCNUMBER = '#url.docnumber#')
														<CFELSEIF isDefined("form.hidDocnumber")>(B.DOCNUMBER = '#form.hidDocnumber#')
														<CFELSEIF isDefined("form.edtBatchnumber")>(B.DOCNUMBER = '#form.edtBatchnumber#')</CFIF>
														GROUP BY A.BATCHID)) 
												AND (PERSONNELIDNO = '#i#') AND (COLUMNNAME='#COLUMNNAME#')
										</CFQUERY>
										<CFSET sFldValue=qryDTL.FIELDVALUE>
									<CFELSEIF ListFindNoCase(GetData.FLDDATES,GetFields.COLUMNNAME) NEQ 0>
										<CFSET sFldValue= theDate>
									<CFELSE>
										<CFSET sFldValue=""><!--- assume blank --->
									</CFIF>
								<CFELSE>	
									<CFSET sFldValue= evaluate("form.edt" & GetFields.COLUMNNAME)>
									<CFQUERY NAME="update2Dtl" DATASOURCE="#client.company_dsn#">
										UPDATE ECINBATCHDTL 
										SET FIELDVALUE = '#sFldValue#'
											, USERID = '#client.userid#'
											, DATELASTUPDATE = '#DateFormat(Now(),"mm/dd/yyyy")#'
											, TIMELASTUPDATE = '#TimeFormat(Now(),"HH:mm:ss")#'
										WHERE  (BATCHID =
											(SELECT DISTINCT (A.BATCHID)
											FROM ECINBATCHDTL A, ECINBATCHEMPS B
											WHERE A.BATCHID = B.BATCHID AND (A.BATCHID = '#GetData.BATCHID#') AND 
												(A.DOCNUMBER = B.DOCNUMBER) AND
												(A.PERSONNELIDNO = '#i#') AND 
												<CFIF isDefined("url.docnumber")>(B.DOCNUMBER = '#url.docnumber#')
												<CFELSEIF isDefined("form.hidDocnumber")>(B.DOCNUMBER = '#form.hidDocnumber#')
												<CFELSEIF isDefined("form.edtBatchnumber")>(B.DOCNUMBER = '#form.edtBatchnumber#')</CFIF>
												GROUP BY A.BATCHID)) 
										AND (PERSONNELIDNO = '#i#') AND (COLUMNNAME='#COLUMNNAME#')
									</CFQUERY>
								</CFIF>
								<CFTRANSACTION ACTION="COMMIT"/>
								<CFCATCH TYPE="Database">
									<CFSET sWarn = "#CFCATCH.MESSAGE#" & "<BR>" & "#CFCATCH.DETAIL#" & "<BR>" & "#CFCATCH.SQL#">
									<CFTRANSACTION ACTION="ROLLBACK"/>
								</CFCATCH>
							</CFTRY>
						<CFELSE>
							<CFTRY>
								<CFIF FindNoCase(autogen.FIELDNAME,COLUMNNAME) NEQ 0>
									<CFMODULE TEMPLATE="#client.common_path#cfm_leveldsn.cfm" DBLEVEL="#GetLevel.LEVELID#">
									<!--- assign autogen values for each record -- this will be re-checked on route --->
									<CFIF DSN NEQ "" AND autogen.FIELDNAME NEQ ""> 
										<CFMODULE TEMPLATE="#client.common_path#autogenfield.cfm"
											SEEDKEY="#autogen.SEEDKEY#"
											CODELENGTH="#autogen.CODELENGTH#"
											COLUMNNAME="#COLUMNNAME#"
											TABLENAME_FK="ECINBATCHDTL"
											DATASOURCE="#client.company_dsn#"
											WITHDATE="#autogen.WITHDATE#"
											SOURCETABLE="#GetData.TABLENAME_FK#">
									</CFIF>
									<CFQUERY NAME="insert2Dtl" DATASOURCE="#client.company_dsn#">
										INSERT INTO ECINBATCHDTL (TABLENAME, COLUMNNAME, FIELDVALUE, BATCHID, DOCNUMBER, ROUTEID, PERSONNELIDNO, ISROUTED, REFERENCEID, RECCREATEDBY, RECDATECREATED, USERID, DATELASTUPDATE, TIMELASTUPDATE)
										VALUES ('#GetData.TABLENAME_FK#', 
											'#COLUMNNAME#', 
											'#AUTOGENVALUE#',
											'#GetData.BATCHID#', 
											'#form.edtBatchNumber#', 
											'',
											'#i#',
											'N', 
											'#sRefID#',
											'#client.userid#', 
											'#DateFormat(Now(),"mm/dd/yyyy")#',
											'#client.userid#',
											'#DateFormat(Now(),"mm/dd/yyyy")#',
											'#TimeFormat(Now(),"HH:mm:ss")#')
									</CFQUERY>
								<CFELSEIF ListFindNoCase(GetData.FLDDATES,COLUMNNAME) NEQ 0>
									<CFQUERY NAME="insert2Dtl" DATASOURCE="#client.company_dsn#">
										INSERT INTO ECINBATCHDTL (TABLENAME, COLUMNNAME, FIELDVALUE, BATCHID, DOCNUMBER, ROUTEID, PERSONNELIDNO, ISROUTED, REFERENCEID, RECCREATEDBY, RECDATECREATED, USERID, DATELASTUPDATE, TIMELASTUPDATE)
										VALUES ('#GetData.TABLENAME_FK#', 
											'#COLUMNNAME#', 
											<CFIF COLUMNNAME EQ stheID>'#i#'<CFELSE>'#theDate#'</CFIF>,
											'#GetData.BATCHID#', 
											'#form.edtBatchNumber#',
											'',
											'#i#',
											'N', 
											'#sRefID#',
											'#client.userid#', 
											'#DateFormat(Now(),"mm/dd/yyyy")#',
											'#client.userid#',
											'#DateFormat(Now(),"mm/dd/yyyy")#',
											'#TimeFormat(Now(),"HH:mm:ss")#')
									</CFQUERY>
								<CFELSE>
									<CFSET tmpFld = "form.edt" & COLUMNNAME>
									<CFQUERY NAME="insert2Dtl" DATASOURCE="#client.company_dsn#">
										INSERT INTO ECINBATCHDTL (TABLENAME, COLUMNNAME, FIELDVALUE, BATCHID, DOCNUMBER, ROUTEID, PERSONNELIDNO, ISROUTED, REFERENCEID, RECCREATEDBY, RECDATECREATED, USERID, DATELASTUPDATE, TIMELASTUPDATE)
										VALUES ('#GetData.TABLENAME_FK#', 
											'#COLUMNNAME#', 
											<CFIF COLUMNNAME EQ stheID>'#i#'<CFELSEIF isDefined("#tmpFld#")>'#evaluate("form.edt" & COLUMNNAME)#'<CFELSE>''</CFIF>,
											'#GetData.BATCHID#', 
											'#form.edtBatchNumber#',
											'',
											'#i#',
											'N', 
											'#sRefID#',
											'#client.userid#', 
											'#DateFormat(Now(),"mm/dd/yyyy")#',
											'#client.userid#',
											'#DateFormat(Now(),"mm/dd/yyyy")#',
											'#TimeFormat(Now(),"HH:mm:ss")#')
									</CFQUERY>
								</CFIF>
								<CFTRANSACTION ACTION="COMMIT"/>
								<CFCATCH TYPE="Database">
									<CFSET sWarn = "#CFCATCH.MESSAGE#" & "<BR>" & "#CFCATCH.DETAIL#">
									<CFTRANSACTION ACTION="ROLLBACK"/>
								</CFCATCH>
							</CFTRY>
						</CFIF>
					</CFLOOP>
					<CFSET theDate= DATEFORMAT(DateAdd("D",1, "#theDate#"),"mm/dd/yyyy")>
				</CFLOOP>
			</CFLOOP>
		<CFELSE>
			<CFSET sWarn = "An error was encountered, please check your date range.<br>">
		</CFIF>
	<CFELSE>
		<CFLOOP LIST="#form.chkEmps#" INDEX="i">
			<CFSET sRefID = CreateUUID()>
			<CFQUERY NAME="checkExist" DATASOURCE="#client.company_dsn#">
				SELECT A.* FROM ECINBATCHDTL A, ECINBATCHEMPS B
				WHERE 	(A.BATCHID = B.BATCHID) AND 
					(A.BATCHID = '#GetData.BATCHID#') AND
					(A.DOCNUMBER = B.DOCNUMBER) AND
					<CFIF isDefined("url.docnumber")>(A.DOCNUMBER = '#url.docnumber#')
					<CFELSEIF isDefined("form.hidDocnumber")>(A.DOCNUMBER = '#form.hidDocnumber#')
					<CFELSEIF isDefined("form.edtBatchnumber")>(A.DOCNUMBER = '#form.edtBatchnumber#')</CFIF> AND 
					(A.PERSONNELIDNO IN ('#i#'))
			</CFQUERY>
			<CFLOOP QUERY="GetFields">
				<CFIF checkExist.RECORDCOUNT NEQ 0>
					<CFSET sFrmField = "form.edt" & GetFields.COLUMNNAME>
					<CFTRY>
						<CFIF NOT isDefined("#sFrmField#")><!--- field does not exist in form, check if autogen or date range--->
							<CFQUERY NAME="autogen" DATASOURCE="#client.global_dsn#">
								SELECT FIELDNAME, SEEDKEY, CODELENGTH, WITHDATE FROM GSTAUTOGENFIELD
								WHERE TABLENAME = '#GetData.TABLENAME_FK#' AND FIELDNAME = '#COLUMNNAME#'
							</CFQUERY>	
							<CFIF COLUMNNAME EQ "PERSONNELIDNO" OR COLUMNNAME EQ "PERSONNELBADGENO">
								<CFSET sFldValue=i>
							<CFELSEIF autogen.RECORDCOUNT>
								<CFQUERY NAME="qryDTL" DATASOURCE="#client.company_dsn#">
									SELECT COLUMNNAME, FIELDVALUE FROM ECINBATCHDTL
									WHERE (BATCHID =
											(SELECT DISTINCT (A.BATCHID)
											FROM ECINBATCHDTL A, ECINBATCHEMPS B
											WHERE A.BATCHID = B.BATCHID AND (A.BATCHID = '#GetData.BATCHID#') AND 
												(A.PERSONNELIDNO = '#i#') AND 
												<CFIF isDefined("url.docnumber")>(B.DOCNUMBER = '#url.docnumber#')
												<CFELSEIF isDefined("form.hidDocnumber")>(B.DOCNUMBER = '#form.hidDocnumber#')
												<CFELSEIF isDefined("form.edtBatchnumber")>(B.DOCNUMBER = '#form.edtBatchnumber#')</CFIF>
												GROUP BY A.BATCHID)) 
										AND (PERSONNELIDNO = '#i#') AND (COLUMNNAME='#COLUMNNAME#')
								</CFQUERY>
								<CFSET sFldValue=qryDTL.FIELDVALUE>
							<CFELSE>
								<CFSET sFldValue=""><!--- assume blank --->
							</CFIF>
						<CFELSE>	
							<CFSET sFldValue= evaluate("form.edt" & GetFields.COLUMNNAME)>
							<CFQUERY NAME="update2Dtl" DATASOURCE="#client.company_dsn#">
								UPDATE ECINBATCHDTL 
								SET FIELDVALUE = '#sFldValue#'
									, USERID = '#client.userid#'
									, DATELASTUPDATE = '#DateFormat(Now(),"mm/dd/yyyy")#'
									, TIMELASTUPDATE = '#TimeFormat(Now(),"HH:mm:ss")#'
								WHERE  (BATCHID =
									(SELECT DISTINCT (A.BATCHID)
									FROM ECINBATCHDTL A, ECINBATCHEMPS B
									WHERE A.BATCHID = B.BATCHID AND (A.BATCHID = '#GetData.BATCHID#') AND 
										(A.DOCNUMBER = B.DOCNUMBER) AND
										(A.PERSONNELIDNO = '#i#') AND 
										<CFIF isDefined("url.docnumber")>(B.DOCNUMBER = '#url.docnumber#')
										<CFELSEIF isDefined("form.hidDocnumber")>(B.DOCNUMBER = '#form.hidDocnumber#')
										<CFELSEIF isDefined("form.edtBatchnumber")>(B.DOCNUMBER = '#form.edtBatchnumber#')</CFIF>
										GROUP BY A.BATCHID)) 
								AND (PERSONNELIDNO = '#i#') AND (COLUMNNAME='#COLUMNNAME#')
							</CFQUERY>
						</CFIF>
						<CFTRANSACTION ACTION="COMMIT"/>
						<CFCATCH TYPE="Database">
							<CFSET sWarn = "#CFCATCH.MESSAGE#" & "<BR>" & "#CFCATCH.DETAIL#" & "<BR>" & "#CFCATCH.SQL#">
							<CFTRANSACTION ACTION="ROLLBACK"/>
						</CFCATCH>
					</CFTRY>
				<CFELSE>
					<CFTRY>
						<CFIF FindNoCase(autogen.FIELDNAME,COLUMNNAME) NEQ 0>
							<CFMODULE TEMPLATE="#client.common_path#cfm_leveldsn.cfm" DBLEVEL="#GetLevel.LEVELID#">
							<!--- assign autogen values for each record -- this will be re-checked on route --->
							<CFIF DSN NEQ "" AND autogen.FIELDNAME NEQ ""> 
								<CFMODULE TEMPLATE="#client.common_path#autogenfield.cfm"
									SEEDKEY="#autogen.SEEDKEY#"
									CODELENGTH="#autogen.CODELENGTH#"
									COLUMNNAME="#COLUMNNAME#"
									TABLENAME_FK="ECINBATCHDTL"
									DATASOURCE="#client.company_dsn#"
									WITHDATE="#autogen.WITHDATE#"
									SOURCETABLE="#GetData.TABLENAME_FK#">
							</CFIF>
							<CFQUERY NAME="insert2Dtl" DATASOURCE="#client.company_dsn#">
								INSERT INTO ECINBATCHDTL (TABLENAME, COLUMNNAME, FIELDVALUE, BATCHID, DOCNUMBER, ROUTEID, PERSONNELIDNO, ISROUTED, REFERENCEID, RECCREATEDBY, RECDATECREATED, USERID, DATELASTUPDATE, TIMELASTUPDATE)
								VALUES ('#GetData.TABLENAME_FK#', 
									'#COLUMNNAME#', 
									'#AUTOGENVALUE#',
									'#GetData.BATCHID#', 
									'#form.edtBatchNumber#', 
									'',
									'#i#',
									'N', 
									'#sRefID#',
									'#client.userid#', 
									'#DateFormat(Now(),"mm/dd/yyyy")#',
									'#client.userid#',
									'#DateFormat(Now(),"mm/dd/yyyy")#',
									'#TimeFormat(Now(),"HH:mm:ss")#')
							</CFQUERY>
						<CFELSE>
							<CFSET tmpFld = "form.edt" & COLUMNNAME>
							<CFQUERY NAME="insert2Dtl" DATASOURCE="#client.company_dsn#">
								INSERT INTO ECINBATCHDTL (TABLENAME, COLUMNNAME, FIELDVALUE, BATCHID, DOCNUMBER, ROUTEID, PERSONNELIDNO, ISROUTED, REFERENCEID, RECCREATEDBY, RECDATECREATED, USERID, DATELASTUPDATE, TIMELASTUPDATE)
								VALUES ('#GetData.TABLENAME_FK#', 
									'#COLUMNNAME#', 
									<CFIF COLUMNNAME EQ stheID>'#i#'<CFELSEIF isDefined("#tmpFld#")>'#evaluate("form.edt" & COLUMNNAME)#'<CFELSE>''</CFIF>,
									'#GetData.BATCHID#', 
									'#form.edtBatchNumber#',
									'',
									'#i#',
									'N', 
									'#sRefID#',
									'#client.userid#', 
									'#DateFormat(Now(),"mm/dd/yyyy")#',
									'#client.userid#',
									'#DateFormat(Now(),"mm/dd/yyyy")#',
									'#TimeFormat(Now(),"HH:mm:ss")#')
							</CFQUERY>
						</CFIF>
						<CFTRANSACTION ACTION="COMMIT"/>
						<CFCATCH TYPE="Database">
							<CFSET sWarn = "#CFCATCH.MESSAGE#" & "<BR>" & "#CFCATCH.DETAIL#">
							<CFTRANSACTION ACTION="ROLLBACK"/>
						</CFCATCH>
					</CFTRY>
				</CFIF>
			</CFLOOP>
		</CFLOOP>
	</CFIF>
	<CFSET sMess = "Record(s) successfully updated.">
<CFELSEIF (isDefined("form.btnUpdateRecs") AND isDefined("form.chkRecs") AND form.chkRecs NEQ "")>
	<CFLOOP LIST="#form.chkRecs#" INDEX="i">
		<CFSET sRefID = CreateUUID()>
		<CFIF isDefined("url.returned")>
			<CFSET sCondition = "ROUTEID = '#i#'">
		<CFELSE>
			<CFSET sCondition = "REFERENCEID = '#i#'">
		</CFIF>
		<CFQUERY NAME="checkExist" DATASOURCE="#client.company_dsn#">
			SELECT * FROM ECINBATCHDTL
			WHERE #preserveSingleQuotes(sCondition)#
		</CFQUERY>
		<CFLOOP QUERY="GetFields">
			<CFIF checkExist.RECORDCOUNT NEQ 0>
				<CFSET sFrmField = "form.edt" & GetFields.COLUMNNAME>
				<CFTRY>
					<CFIF isDefined("#sFrmField#")>	
						<!--- check if entry exists --->
						<CFQUERY NAME="checkDtlExist" DATASOURCE="#client.company_dsn#">
							SELECT COLUMNNAME, FIELDVALUE FROM ECINBATCHDTL 
							WHERE (#preserveSingleQuotes(sCondition)#) AND (COLUMNNAME='#COLUMNNAME#')
						</CFQUERY>
						<CFSET sFldValue= evaluate("form.edt" & GetFields.COLUMNNAME)>
						<CFIF checkDtlExist.RECORDCOUNT>
							<CFQUERY NAME="update2Dtl" DATASOURCE="#client.company_dsn#">
								UPDATE ECINBATCHDTL 
								SET FIELDVALUE = '#sFldValue#'
									, USERID = '#client.userid#'
									, DATELASTUPDATE = '#DateFormat(Now(),"mm/dd/yyyy")#'
									, TIMELASTUPDATE = '#TimeFormat(Now(),"HH:mm:ss")#'
								WHERE (#preserveSingleQuotes(sCondition)#) AND (COLUMNNAME='#COLUMNNAME#')
							</CFQUERY>
						<CFELSE><!--- previously blank, now with value or newly added field --->
							<CFQUERY NAME="insert2Dtl" DATASOURCE="#client.company_dsn#">
								INSERT INTO ECINBATCHDTL (TABLENAME, COLUMNNAME, FIELDVALUE, BATCHID, DOCNUMBER, ROUTEID, PERSONNELIDNO, ISROUTED, REFERENCEID, RECCREATEDBY, RECDATECREATED, USERID, DATELASTUPDATE, TIMELASTUPDATE)
								VALUES ('#GetData.TABLENAME_FK#', 
									'#COLUMNNAME#', 
									'#evaluate("form.edt" & COLUMNNAME)#',
									'#GetForm.FORMCODE#', 
									'#form.edtBatchNumber#',
									'<CFIF isDefined("url.routeid")>#url.routeid#</CFIF>',
									'#url.employeeid#',
									'N', 
									'#checkExist.REFERENCEID#',
									'#client.userid#', 
									'#DateFormat(Now(),"mm/dd/yyyy")#',
									'#client.userid#',
									'#DateFormat(Now(),"mm/dd/yyyy")#',
									'#TimeFormat(Now(),"HH:mm:ss")#')
							</CFQUERY>
						</CFIF>
					</CFIF>
					<CFTRANSACTION ACTION="COMMIT"/>
					<CFCATCH TYPE="Database">
						<CFSET sWarn = "#CFCATCH.MESSAGE#" & "<BR>" & "#CFCATCH.DETAIL#" & "<BR>" & "#CFCATCH.SQL#">
						<CFTRANSACTION ACTION="ROLLBACK"/>
					</CFCATCH>
				</CFTRY>
			<CFELSE>
				<CFTRY>
					<CFIF FindNoCase(autogen.FIELDNAME,COLUMNNAME) NEQ 0>
						<CFMODULE TEMPLATE="#client.common_path#cfm_leveldsn.cfm" DBLEVEL="#GetLevel.LEVELID#">
						<!--- assign autogen values for each record -- this will be re-checked on route --->
						<CFIF DSN NEQ "" AND autogen.FIELDNAME NEQ ""> 
							<CFMODULE TEMPLATE="#client.common_path#autogenfield.cfm"
								SEEDKEY="#autogen.SEEDKEY#"
								CODELENGTH="#autogen.CODELENGTH#"
								COLUMNNAME="#COLUMNNAME#"
								TABLENAME_FK="ECINBATCHDTL"
								DATASOURCE="#client.company_dsn#"
								WITHDATE="#autogen.WITHDATE#"
								SOURCETABLE="#GetData.TABLENAME_FK#">
						</CFIF>
						<CFQUERY NAME="insert2Dtl" DATASOURCE="#client.company_dsn#">
							INSERT INTO ECINBATCHDTL (TABLENAME, COLUMNNAME, FIELDVALUE, BATCHID, DOCNUMBER, ROUTEID, PERSONNELIDNO, ISROUTED, REFERENCEID, RECCREATEDBY, RECDATECREATED, USERID, DATELASTUPDATE, TIMELASTUPDATE)
							VALUES ('#GetData.TABLENAME_FK#', 
								'#COLUMNNAME#', 
								'#AUTOGENVALUE#',
								'#GetForm.FORMCODE#', 
								'#form.edtBatchNumber#', 
								'<CFIF isDefined("url.routeid")>#url.routeid#</CFIF>',
								'#url.employeeid#',
								'N', 
								'#sRefID#',
								'#client.userid#', 
								'#DateFormat(Now(),"mm/dd/yyyy")#',
								'#client.userid#',
								'#DateFormat(Now(),"mm/dd/yyyy")#',
								'#TimeFormat(Now(),"HH:mm:ss")#')
						</CFQUERY>
					<CFELSE>
						<CFSET tmpFld = "form.edt" & COLUMNNAME>
						<CFQUERY NAME="insert2Dtl" DATASOURCE="#client.company_dsn#">
							INSERT INTO ECINBATCHDTL (TABLENAME, COLUMNNAME, FIELDVALUE, BATCHID, DOCNUMBER, ROUTEID, PERSONNELIDNO, ISROUTED, REFERENCEID, RECCREATEDBY, RECDATECREATED, USERID, DATELASTUPDATE, TIMELASTUPDATE)
							VALUES ('#GetData.TABLENAME_FK#', 
								'#COLUMNNAME#', 
								<CFIF COLUMNNAME EQ stheID>'#url.employeeid#'<CFELSEIF isDefined("#tmpFld#")>'#evaluate("form.edt" & COLUMNNAME)#'<CFELSE>''</CFIF>,
								'#GetForm.FORMCODE#', 
								'#form.edtBatchNumber#',
								'<CFIF isDefined("url.routeid")>#url.routeid#</CFIF>',
								'#url.employeeid#',
								'N', 
								'#sRefID#',
								'#client.userid#', 
								'#DateFormat(Now(),"mm/dd/yyyy")#',
								'#client.userid#',
								'#DateFormat(Now(),"mm/dd/yyyy")#',
								'#TimeFormat(Now(),"HH:mm:ss")#')
						</CFQUERY>
					</CFIF>
					<CFTRANSACTION ACTION="COMMIT"/>
					<CFCATCH TYPE="Database">
						<CFSET sWarn = "#CFCATCH.MESSAGE#" & "<BR>" & "#CFCATCH.DETAIL#">
						<CFTRANSACTION ACTION="ROLLBACK"/>
					</CFCATCH>
				</CFTRY>
			</CFIF>
		</CFLOOP>
	</CFLOOP>
	<CFSET sMess = "Record(s) successfully updated.">
<CFELSEIF (isDefined("form.btnDeleteRecs") AND isDefined("form.chkRecs") AND form.chkRecs NEQ "")>
	<CFLOOP LIST="#form.chkRecs#" INDEX="i">
		<CFIF isDefined("url.returned")>
			<CFSET sCondition = "ROUTEID = '#i#'">
		<CFELSE>
			<CFSET sCondition = "REFERENCEID = '#i#'">
		</CFIF>
		<CFQUERY NAME="delete2Dtl" DATASOURCE="#client.company_dsn#">
			DELETE FROM ECINBATCHDTL 
			WHERE (#preserveSingleQuotes(sCondition)#)
		</CFQUERY>
	</CFLOOP>
	<CFSET sMess = "Record(s) successfully deleted.">
</CFIF>
<!--- Re-initialize GetData --->
<CFQUERY NAME="GetData" DATASOURCE="#client.company_dsn#">
	SELECT A.PERSONNELIDNO, D.DOCNUMBER, D.DESCRIPTION, B.*,C.*
	FROM ECINBATCHEMPS A, ECRGBATCHAPPLY B, ECRGFORMS C, ECINBATCHAPPLY D
	WHERE 	(A.BATCHID = B.BATCHID) AND
		(B.BATCHID = D.BATCHID) AND
		(A.DOCNUMBER = D.DOCNUMBER) AND
		(B.BATCHID = C.FORMCODE) 
		<CFIF isDefined("url.view")> AND (D.DOCNUMBER = '#url.DOCNUMBER#')
		<CFELSEIF isDefined("form.hidDocnumber")> AND (D.DOCNUMBER = '#form.hidDocnumber#')
		<CFELSEIF isDefined("url.docnumber")> AND (D.DOCNUMBER = '#url.Docnumber#')
		<CFELSEIF isDefined("form.edtBatchNumber")> AND (D.DOCNUMBER = '#form.edtBatchNumber#')</CFIF>
		<CFIF GetData2.RECORDCOUNT>
			<CFIF qryReturned.RECORDCOUNT NEQ 0>
				AND (A.PERSONNELIDNO IN (#QuotedValueList(qryReturned.PERSONNELIDNO)#))
			</CFIF>
		</CFIF>
</CFQUERY>
<!--- re-initialize QueryView --->
<CFQUERY NAME="QueryView" DATASOURCE="#client.company_dsn#">
	SELECT DISTINCT(C.DOCNUMBER), B.DESCRIPTION, C.DESCRIPTION AS BATCHDESC , C.ROUTED
	FROM ECRGBATCHAPPLY A, ECRGFORMS B, ECINBATCHAPPLY C
	WHERE 	(A.BATCHID = C.BATCHID) AND
		(B.FORMCODE = A.BATCHID) AND
		(C.BATCHID = '#GetForm.FORMCODE#')
		<CFIF isDefined("url.view")> AND (C.DOCNUMBER = '#url.DOCNUMBER#')
		<CFELSEIF isDefined("form.hidDocnumber")> AND (C.DOCNUMBER = '#form.hidDocnumber#')
		<CFELSEIF isDefined("url.docnumber")> AND (C.DOCNUMBER = '#url.Docnumber#')
		<CFELSEIF isDefined("form.edtBatchNumber")> AND (C.DOCNUMBER = '#form.edtBatchNumber#')</CFIF>
	GROUP BY C.DOCNUMBER, C.DESCRIPTION, B.DESCRIPTION, C.ROUTED
</CFQUERY>
<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TITLE = "#sAction# Group Application">
	<CFOUTPUT>
		<CFIF sWarn NEQ ""><FONT COLOR="RED"><B>&nbsp;#sWarn#</B></FONT>
		<CFELSEIF isDefined("url.sWarn") AND url.sWarn NEQ ""><FONT COLOR="RED"><B>&nbsp;#url.sWarn#</B></FONT>
		<CFELSEIF sMess NEQ ""><B>&nbsp;#sMess#</B></CFIF>
		<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=3 BGCOLOR="#client.color_grphead#" WIDTH="100%">
			<TR>
				<TD NOWRAP>
					<INPUT TYPE="submit" NAME="btnAdd" VALUE="#sBtnVal# Application" TITLE="Add new record" CLASS="bitbtn" #btnDisable#>
					<CFIF isDefined("url.docnumber") AND isDefined("url.edit") AND url.edit EQ "master">
						<INPUT TYPE="submit" NAME="btnRoute" VALUE="Route" TITLE="Route" CLASS="bitbtn" #btnDisable#>
					</CFIF>
					<INPUT TYPE="button" NAME="btnBack" VALUE="Back" TITLE="Back" CLASS="bitbtn" ONCLICK="javascript: funcBack();">
					<INPUT TYPE="button" NAME="btnRefresh" VALUE="Refresh" TITLE="Refresh" CLASS="bitbtn" ONCLICK="javascript: funcRefresh();">
				<TD>
			</TR>
		</TABLE>
		<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 WIDTH="100%">
			<TR VALIGN="bottom">
				<TD WIDTH="20%">&nbsp;&nbsp;Record No.</TD>
				<TD WIDTH="1">&nbsp;*</TD>
				<CFTRY>
					<CFQUERY NAME="autogen" DATASOURCE="#client.global_dsn#">
						SELECT FIELDNAME, SEEDKEY, CODELENGTH, WITHDATE FROM GSTAUTOGENFIELD
						WHERE TABLENAME = 'ECINBATCHAPPLY'
					</CFQUERY>
					<CFTRANSACTION ACTION="COMMIT"/>
					<CFCATCH TYPE="Database">
						<CFSET sWarn = "#CFCATCH.MESSAGE#" & "<BR>" & "#CFCATCH.DETAIL#">
						<CFTRANSACTION ACTION="ROLLBACK"/>
					</CFCATCH>
				</CFTRY>
				<TD WIDTH="30%">
				<CFIF autogen.RECORDCOUNT>
					<CFMODULE TEMPLATE="#client.common_path#autogenfield.cfm"
						SEEDKEY="#autogen.SEEDKEY#"
						CODELENGTH="#autogen.CODELENGTH#"
						COLUMNNAME="#autogen.FIELDNAME#"
						TABLENAME_FK="ECINBATCHAPPLY"
						DATASOURCE="#client.company_dsn#"
						WITHDATE="#autogen.WITHDATE#">
					<CFIF Queryview.DOCNUMBER EQ "">
						<INPUT TYPE="text" VALUE="#AUTOGENVALUE#" NAME="edtBatchNumber" SIZE="40" readonly>
					<CFELSE>
						<INPUT TYPE="text" VALUE="#Queryview.DOCNUMBER#" NAME="edtBatchNumber" SIZE="40" readonly>
					</CFIF>
					<TD WIDTH="50%">&nbsp;</TD>
				<CFELSE>
					<INPUT TYPE="text" VALUE="" NAME="edtBatchNumber" SIZE="40" readonly><TD WIDTH="50%"><FONT COLOR="RED"><B>There's no configured Autogen value for Docnumber. Please contact your Administrator.</B></FONT></TD>
				</CFIF>	
				</TD>
			</TR>
			<TR VALIGN="bottom">
				<CFIF isDefined("url.view")>
					<CFSET isDescReadOnly = "true">
				<CFELSE>
					<CFSET isDescReadOnly = "false">
				</CFIF>
				<CFMODULE TEMPLATE="#client.common_path#cfm_htmlobject.cfm"
					TYPE="TEXT" ALIGN="LEFT"
					HTMLNAME="edtBatchDesc" VALUE="#QueryView.BATCHDESC#"
					DESCRIPTION="&nbsp;&nbsp;Description" MAXLENGTH = "30"
					SIZE ="40" WIDTH4="20%"
					WITHFIELDDESC="true" WITHAUDITFIELD="true"
					READONLY="#isDescReadOnly#" WIDTH="30%">
			</TR>
		</TABLE>
		<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TITLE="Employee List">
			<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=2 WIDTH="100%">
				<TR>
					<TD colspan=4>
						<INPUT TYPE="SUBMIT" NAME="btnAddEmployees" VALUE = "Add Employees" CLASS="bitbtn" #btnDisable#>&nbsp;
						<INPUT TYPE="SUBMIT" NAME="btnAddToRecord" VALUE = "Save Record" CLASS="bitbtn" DISABLED>&nbsp;
						<INPUT TYPE="SUBMIT" NAME="btnDeleteEmployee" VALUE = "Delete Selected" CLASS="bitbtn" DISABLED onclick="javascript: return confirm('Are you sure you want to delete these record(s)?');">&nbsp;
						<CFIF isDefined("url.returned")><INPUT TYPE="SUBMIT" NAME="btnViewReturned" VALUE = "View Returned Record(s)" CLASS="bitbtn" DISABLED>&nbsp;</CFIF>
					</TD>
				</TR>
				<TR BGCOLOR="#client.color_tblhead#">
					<TD CLASS="boldwhite"><center><INPUT TYPE="CHECKBOX" NAME="chkAllEmps" <CFIF isDefined("url.viewdtl") OR isDefined("form.btnViewReturned")>DISABLED<CFELSE>#btnDisable#</CFIF> <CFIF isDefined("url.returned")>ONCLICK="javascript:chkBoxAll2(document.frmBatchApp.chkEmps);"<CFELSE>ONCLICK="javascript:chkBoxAll(document.frmBatchApp.chkEmps);"</CFIF>></center></TD>
					<!---<TD CLASS="boldwhite">&nbsp;</TD>--->
					<TD CLASS="boldwhite">#stheIDDesc#</TD>
					<TD CLASS="boldwhite">Last Name</TD>
					<TD CLASS="boldwhite">First Name</TD>
					<TD CLASS="boldwhite">Middle Name</TD>
					<TD CLASS="boldwhite">Cost Center Code</TD>
				</TR>
				<!--- ecinbatchemps --->
				<CFMODULE TEMPLATE="#client.common_path#cfm_geturlvariables.cfm" REMOVEURL="sWarn,EMPLOYEEID,DOCNUMBER,VIEW,VIEWDTL">
				<CFLOOP QUERY="GetData">
					<CFQUERY NAME="qryEmployeeMaster" DATASOURCE="#client.company_dsn#">
						SELECT PERSONNELIDNO, PERSONNELBADGENO, LASTNAME, FIRSTNAME, MIDDLENAME, COSTCENTERCODE
						FROM CMFPA
						WHERE 
							#stheID# = '#evaluate("GetData.PERSONNELIDNO")#'
					</CFQUERY>
					<CFQUERY NAME="qryCostCenterDesc" DATASOURCE="#client.company_dsn#">
						SELECT DESCRIPTION
						FROM CLKCOSTCENTERS
						WHERE COSTCENTERCODE = '#qryEmployeeMaster.COSTCENTERCODE#'
					</CFQUERY>
					<TR>
						<TD WIDTH=2><CENTER><INPUT TYPE="CHECKBOX" NAME="chkEmps" VALUE="#GetData.PERSONNELIDNO#" <CFIF isDefined("url.viewdtl") OR isDefined("form.btnViewReturned")>DISABLED<CFELSE>#btnDisable#</CFIF> <CFIF isDefined("url.returned")>ONCLICK="javascript:chkBoxEnable2();"<CFELSE>ONCLICK="javascript:chkBoxEnable();"</CFIF><CFIF isDefined("url.employeeid") AND GetData.PERSONNELIDNO EQ url.employeeid>CHECKED</CFIF>></CENTER></TD>
						<CFIF NOT isDefined("url.returned") AND (Trim(GetData.FLDDATES) EQ "")>
							<!---<TD><CENTER>&nbsp;<CFIF (NOT isDefined("url.view") OR isDefined("url.employeeid"))><a class="regular11" href="#getFileFromPath(getBaseTemplatePath())#?#urlVariables#&DOCNUMBER=#GetData.DOCNUMBER#&EMPLOYEEID=#evaluate("GetData." & stheID)#&edit=true"></CFIF>edit<CFIF (NOT isDefined("url.view") OR isDefined("url.employeeid"))></a></CFIF></CENTER></TD>--->
							<TD>&nbsp;<a class="regular11" href="#getFileFromPath(getBaseTemplatePath())#?#urlVariables#&EMPLOYEEID=#evaluate("GetData.PERSONNELIDNO")#&DOCNUMBER=#GetData.DOCNUMBER#&view=true">#evaluate("GetData.PERSONNELIDNO")#</a></TD>
						<CFELSE>
							<!---<TD>&nbsp;<i>Click Personnelidno to view forms</i></TD>--->
							<TD>&nbsp;<a class="regular11" href="#getFileFromPath(getBaseTemplatePath())#?#urlVariables#&EMPLOYEEID=#evaluate("GetData.PERSONNELIDNO")#&DOCNUMBER=#GetData.DOCNUMBER#&view=&viewdtl=">#evaluate("GetData.PERSONNELIDNO")#</a></TD>
						</CFIF>
						<TD>&nbsp;#qryEmployeeMaster.LASTNAME#</TD>
						<TD>&nbsp;#qryEmployeeMaster.FIRSTNAME#</TD>
						<TD>&nbsp;#qryEmployeeMaster.MIDDLENAME#</TD>
						<TD>&nbsp;
							<CFIF Trim(qryEmployeeMaster.COSTCENTERCODE) NEQ "">
								[#qryEmployeeMaster.COSTCENTERCODE#] - <CFIF Trim(qryCostCenterDesc.DESCRIPTION) NEQ "">#qryCostCenterDesc.DESCRIPTION#<CFELSE><i>Description not found.</i></CFIF>
							<CFELSE>
								<i>No Cost Center Code defined.</i>
							</CFIF>
						</TD>
					</TR>
				</CFLOOP>
				<TR BGCOLOR="#client.color_tblfoot#">
					<TD COLSPAN=7 HEIGHT=18 CLASS="boldwhite" HEIGHT=18>&nbsp;#GetData.RecordCount# records found.</TD>
				</TR>
			</TABLE>
		<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TOP="False">
	</CFOUTPUT>
	<CFIF Trim(GetData.FLDDATES) NEQ "" AND NOT isDefined("url.returned") AND NOT (isDefined("form.btnViewReturned") OR isDefined("url.employeeid"))>
		<CFOUTPUT>
			<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TITLE="Set Date Range">
				<TR>
					<CFMODULE TEMPLATE="#client.common_path#cfm_htmlobject.cfm"
						TYPE="DATE" ALIGN="LEFT"
						HTMLNAME="docRangeStart" VALUE=""
						DESCRIPTION="&nbsp;&nbsp;Start Date"
						REQUIRED="true"
						WITHFIELDDESC="true" WITHAUDITFIELD="true"
						READONLY="false"
						PARAMETERS="frmBatchApp|">
				</TR>
				<TR>
					<CFMODULE TEMPLATE="#client.common_path#cfm_htmlobject.cfm"
						TYPE="DATE" ALIGN="LEFT"
						HTMLNAME="docRangeEnd" VALUE=""
						DESCRIPTION="&nbsp;&nbsp;End Date"
						REQUIRED="true"
						WITHFIELDDESC="true" WITHAUDITFIELD="true"
						READONLY="false"
						PARAMETERS="frmBatchApp|">
				</TR>
			<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TOP="False">
		</CFOUTPUT>
	</CFIF>
	<CFIF (isDefined("url.returned") or (Trim(GetData.FLDDATES) NEQ "")) AND (isDefined("form.btnViewReturned") OR isDefined("url.employeeid"))>
		<CFOUTPUT>
			<CFMODULE TEMPLATE="#client.common_path#cfm_geturlvariables.cfm" REMOVEURL="sWarn,EMPLOYEEID,DOCNUMBER,ROUTEID,VIEW,REFERENCEID,VIEWDTL">
			<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TITLE="eForms">
				<CFSET sEmpID = "">
				<CFSET cFirst = "Y">
				<CFIF isDefined("form.chkEmps")>
					<CFIF ListLen(form.chkEmps) GT 1>
						<CFLOOP LIST="#form.chkEmps#" INDEX="x">
							<CFIF cFirst EQ "Y">
								<CFSET sEmpID = "'" & x & "'">
								<CFSET cFirst = "N">
							<CFELSE>
								<CFSET sEmpID = sEmpID & ",'" & x & "'">
							</CFIF>
						</CFLOOP>
					<CFELSE>
						<CFSET sEmpID = "'" & form.chkEmps & "'">
					</CFIF>
				<CFELSE>
					<CFSET sEmpID = "'" & url.employeeid & "'">
				</CFIF>
				<CFIF isDefined("url.returned")>
					<!--- get PK --->
					<CFQUERY NAME="qryReturnedRecs" DATASOURCE="#client.company_dsn#">
						SELECT FIELDVALUE, PERSONNELIDNO, ROUTEID, DOCNUMBER
						FROM ECINBATCHDTL
						WHERE 	
							(DOCNUMBER = '#url.docnumber#') AND 
							(PERSONNELIDNO IN (#preserveSingleQuotes(sEmpID)#)) AND 
							(COLUMNNAME = '#GetData.PK_FIELD1#') AND
							(ROUTEID IN 
								(SELECT ROUTEID FROM #GetData.TABLENAME_FK# 
									WHERE (APPROVED = 'R') AND
									(PERSONNELIDNO IN (#preserveSingleQuotes(sEmpID)#))
								)
							)
						ORDER BY FIELDVALUE, PERSONNELIDNO
					</CFQUERY>
					<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=2 WIDTH="100%">
						<TR>
							<TD colspan=4>
								<INPUT TYPE="SUBMIT" NAME="btnUpdateRecs" VALUE = "Update Record" CLASS="bitbtn" DISABLED>&nbsp;
								<INPUT TYPE="SUBMIT" NAME="btnDeleteRecs" VALUE = "Delete Selected" CLASS="bitbtn" DISABLED onclick="javascript: return confirm('Are you sure you want to delete these record(s)?');">&nbsp;
							</TD>
						</TR>
						<TR BGCOLOR="#client.color_tblhead#">
							<TD CLASS="boldwhite"><center><INPUT TYPE="CHECKBOX" NAME="chkAllRecs" #btnDisable# ONCLICK="javascript:chkBoxAllRecs(document.frmBatchApp.chkRecs);"></center></TD>
							<TD CLASS="boldwhite">&nbsp;</TD>
							<TD CLASS="boldwhite">#GetData.PK_FIELD1#</TD>
							<TD CLASS="boldwhite">#stheIDDesc#</TD>
						</TR>
						<CFLOOP QUERY="qryReturnedRecs">
							<TR>
								<TD><center><INPUT TYPE="CHECKBOX" NAME="chkRecs" VALUE="#ROUTEID#" #btnDisable# ONCLICK="javascript:chkEnableRecbtn();" <CFIF isDefined("url.ROUTEID") AND url.routeid EQ ROUTEID>CHECKED</CFIF></CENTER></TD>
								<TD>&nbsp;</TD>
								<TD><a class="regular11" href="#getFileFromPath(getBaseTemplatePath())#?#urlVariables#&EMPLOYEEID=#PERSONNELIDNO#&DOCNUMBER=#DOCNUMBER#&ROUTEID=#ROUTEID#&view=">#FIELDVALUE#</TD>
								<TD>#PERSONNELIDNO#</TD>
							</TR>
						</CFLOOP>
						<TR BGCOLOR="#client.color_tblfoot#">
						<TD COLSPAN=6 HEIGHT=18 CLASS="boldwhite" HEIGHT=18>&nbsp;#qryReturnedRecs.RecordCount# records found.</TD>
					</TR>
					</TABLE>
				<CFELSE>
					<!--- get PK --->
					<CFQUERY NAME="qryReturnedRecs" DATASOURCE="#client.company_dsn#">
						SELECT FIELDVALUE, PERSONNELIDNO, ROUTEID, DOCNUMBER, REFERENCEID
						FROM ECINBATCHDTL
						WHERE 	
							(DOCNUMBER = '#url.docnumber#') AND 
							(PERSONNELIDNO IN (#preserveSingleQuotes(sEmpID)#)) AND 
							(COLUMNNAME = '#GetData.PK_FIELD1#')
						ORDER BY FIELDVALUE, PERSONNELIDNO
					</CFQUERY>
					<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=2 WIDTH="100%">
						<TR>
							<TD colspan=4>
								<INPUT TYPE="SUBMIT" NAME="btnUpdateRecs" VALUE = "Update Record" CLASS="bitbtn" DISABLED>&nbsp;
								<INPUT TYPE="SUBMIT" NAME="btnDeleteRecs" VALUE = "Delete Selected" CLASS="bitbtn" DISABLED onclick="javascript: return confirm('Are you sure you want to delete these record(s)?');">&nbsp;
							</TD>
						</TR>
						<TR BGCOLOR="#client.color_tblhead#">
							<TD CLASS="boldwhite"><center><INPUT TYPE="CHECKBOX" NAME="chkAllRecs" #btnDisable# ONCLICK="javascript:chkBoxAllRecs(document.frmBatchApp.chkRecs);"></center></TD>
							<TD CLASS="boldwhite">&nbsp;</TD>
							<TD CLASS="boldwhite">#GetData.PK_FIELD1#</TD>
							<TD CLASS="boldwhite">#stheIDDesc#</TD>
						</TR>
						<CFLOOP QUERY="qryReturnedRecs">
							<TR>
								<TD><center><INPUT TYPE="CHECKBOX" NAME="chkRecs" VALUE="#REFERENCEID#" #btnDisable# ONCLICK="javascript:chkEnableRecbtn();" <CFIF isDefined("url.REFERENCEID") AND url.REFERENCEID EQ REFERENCEID>CHECKED</CFIF></CENTER></TD>
								<TD>&nbsp;</TD>
								<TD><a class="regular11" href="#getFileFromPath(getBaseTemplatePath())#?#urlVariables#&EMPLOYEEID=#PERSONNELIDNO#&DOCNUMBER=#DOCNUMBER#&REFERENCEID=#REFERENCEID#&view=">#FIELDVALUE#</TD>
								<TD>#PERSONNELIDNO#</TD>
							</TR>
						</CFLOOP>
						<TR BGCOLOR="#client.color_tblfoot#">
						<TD COLSPAN=6 HEIGHT=18 CLASS="boldwhite" HEIGHT=18>&nbsp;#qryReturnedRecs.RecordCount# records found.</TD>
					</TR>
					</TABLE>
				</CFIF>
			<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TOP="False">
		</CFOUTPUT>
	</CFIF>
	<CFOUTPUT>
		<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TITLE="eForm Details">
	</CFOUTPUT>
	<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 WIDTH="100%">
		<CFOUTPUT>
			<CFIF isDefined("url.returned") AND isDefined("url.ROUTEID")>
				<!--- approver's comments --->
				<CFQUERY NAME="qryRecComment" DATASOURCE="#client.company_dsn#">
					SELECT ROUTERREMARKS, ROUTER FROM CRGROUTEDETAILS
					WHERE (ROUTEID = '#url.ROUTEID#') AND (STATUS = 'RETURN')
						AND CURRENTSEQUENCE = (SELECT MAX(CURRENTSEQUENCE) FROM CRGROUTEDETAILS
						WHERE (ROUTEID = '#url.ROUTEID#') AND (STATUS = 'RETURN'))
				</CFQUERY>
				<TR>
					<TD><B>Approver:</B></TD><TD>#qryRecComment.ROUTER#</TD>
				</TR>
				<TR>
					<TD><B>Comment:</B></TD> <TD><CFIF trim(qryRecComment.ROUTERREMARKS) NEQ "">#qryRecComment.ROUTERREMARKS#<CFELSE><I>None.</I></CFIF></TD>
				</TR>
				<TR><TD COLSPAN=2><HR></TD></TR>
			</CFIF>
			<TR VALIGN="bottom">
				<TD ALIGN="right"><IMG SRC="#client.image_path##session.site_ibose#"></TD>
				<TD NOWRAP CLASS="bold14" WIDTH="100%"><FONT FACE="Impact" SIZE="+2">#client.companyname#</FONT><BR>#GetData.DESCRIPTION#</TD>
			</TR>
		</CFOUTPUT>
	</TABLE>
	<TABLE BORDER=0 CELLSPACING=3 CELLPADDING=0 WIDTH="100%" BGCOLOR="#FFFFFF">
		<CFOUTPUT>
			<TR><TD>&nbsp;</TD>
			</TR>
			<CFSET sEntryValue = "">
			<CFSET sfldFilter="">
			<CFSET sfldVal="">
			<CFLOOP QUERY="GetFields">
				<CFQUERY NAME="qryAutoGenFld" DATASOURCE="#client.global_dsn#">
					SELECT FIELDNAME FROM GSTAUTOGENFIELD
					WHERE TABLENAME = '#GetData.TABLENAME_FK#' AND FIELDNAME = '#COLUMNNAME#'
				</CFQUERY>
				<CFMODULE TEMPLATE="#client.common_path#cfm_bosesize.cfm" CURRENTSIZE=#DISPLAYWIDTH#>
				<CFMODULE TEMPLATE="#client.common_path#get_default_value.cfm" EntryValue="#DEFAULTVALUE#">
				<CFSET sEntryValue = sDefaultValue>
				<CFIF isDefined("url.EmployeeID")>
					<CFQUERY NAME="qryDtlData" DATASOURCE="#client.company_dsn#">
						SELECT FIELDVALUE FROM ECINBATCHDTL
						WHERE 	(COLUMNNAME = '#COLUMNNAME#') AND 
							(PERSONNELIDNO = '#url.EMPLOYEEID#') AND
							(BATCHID = '#GetData.BATCHID#') AND
							<CFIF isDefined("url.docnumber")>(DOCNUMBER = '#url.docnumber#')
							<CFELSEIF isDefined("form.hidDocnumber")>(DOCNUMBER = '#form.hidDocnumber#')
							<CFELSEIF isDefined("form.edtBatchnumber")>(DOCNUMBER = '#form.edtBatchnumber#')</CFIF>
							<CFIF isDefined("url.returned") AND isDefined("url.ROUTEID")>
								AND (ROUTEID = '#url.ROUTEID#') 
							</CFIF>
							<CFIF isDefined("url.referenceid")> AND (REFERENCEID = '#url.referenceid#')</CFIF>
					</CFQUERY>
					<CFSET sEntryValue = qryDtlData.FIELDVALUE>
				</CFIF>
				<TR>
					<CFIF COLUMNREQUIRED EQ "Y">
						<CFSET isRequired = "true">
					<CFELSE>
						<CFSET isRequired = "false">
					</CFIF>
					<CFIF ISEDITABLEEFORM EQ "Y" AND NOT isDefined("url.view") OR isDefined("url.returned") OR isDefined("url.routeid") OR isDefined("url.referenceid")>
						<CFSET isReadonly = "false">
					</CFIF>
				<CFIF (NOT qryAutoGenFld.RECORDCOUNT AND COLUMNNAME NEQ "PERSONNELIDNO" AND COLUMNNAME NEQ "PERSONNELBADGENO" AND NOT ListFindNoCase(GetData.FLDDATES,COLUMNNAME) NEQ 0) OR (isDefined("url.EmployeeID") AND isDefined("url.view"))>
					<CFIF (isDefined("url.routeid") OR isDefined("url.referenceid")) AND ((qryAutoGenFld.RECORDCOUNT) OR (COLUMNNAME EQ "PERSONNELIDNO") OR (COLUMNNAME EQ "PERSONNELBADGENO"))>
						<CFSET isReadonly = "true">
					</CFIF>
					<CFIF lcase(COLUMNTYPE) EQ "ftCurrency">
						<CFMODULE TEMPLATE="#client.common_path#cfm_htmlobject.cfm"
							TYPE="TEXT" ALIGN="LEFT"
							HTMLNAME="edt#COLUMNNAME#" VALUE="#sEntryValue#"
							DESCRIPTION="&nbsp;&nbsp;#COLUMNDESC#" MAXLENGTH = "15"
							REQUIRED="#isRequired#" SIZE ="15"
							WITHFIELDDESC="true" WITHAUDITFIELD="true"
							READONLY="#isReadonly#" HINT="#HINT#"
							PARAMETERS2=""onBlur="formatNumber(this)""">
					<CFELSEIF lcase(COLUMNTYPE) EQ "ftfloat" OR lcase(COLUMNTYPE) EQ "ftsmallint" OR lcase(COLUMNTYPE) EQ "ftinteger">
						<CFMODULE TEMPLATE="#client.common_path#cfm_htmlobject.cfm"
							TYPE="TEXT"  ALIGN="LEFT"
							HTMLNAME="edt#COLUMNNAME#" VALUE="#sEntryValue#"
							DESCRIPTION="&nbsp;&nbsp;#COLUMNDESC#" MAXLENGTH = "15"
							REQUIRED="#isRequired#"  SIZE ="15"
							WITHFIELDDESC="true" WITHAUDITFIELD="true"
							READONLY="#isReadonly#" HINT="#HINT#"
							PARAMETERS2="onkeyup=""CheckDigit('0123456789', this)""">
					<CFELSEIF lcase(COLUMNTYPE) EQ "ftdatetime">
						<CFMODULE TEMPLATE="#client.common_path#cfm_htmlobject.cfm"
							TYPE="DATE" ALIGN="LEFT"
							HTMLNAME="edt#COLUMNNAME#" VALUE="#sEntryValue#"
							DESCRIPTION="&nbsp;&nbsp;#COLUMNDESC#"
							REQUIRED="#isRequired#"
							WITHFIELDDESC="true" WITHAUDITFIELD="true"
							READONLY="#isReadonly#" HINT="#HINT#"
							PARAMETERS="frmBatchApp|">
					<CFELSEIF lcase(COLUMNTYPE) EQ "ftmemo">
						<CFMODULE TEMPLATE="#client.common_path#cfm_htmlobject.cfm"
							TYPE="TEXTAREA" ALIGN="LEFT"
							HTMLNAME="edt#COLUMNNAME#" VALUE="#sEntryValue#"
							DESCRIPTION="&nbsp;&nbsp;#COLUMNDESC#" SIZE="#BOSESIZE#"
							REQUIRED="#isRequired#"
							WITHFIELDDESC="true" WITHAUDITFIELD="true"
							READONLY="#isReadonly#" HINT="#HINT#">
					<CFELSEIF lcase(COLUMNTYPE) EQ "ftgraphic" OR lcase(COLUMNTYPE) EQ "ftblob">
						interface not supported.
					<CFELSEIF lcase(COLUMNTYPE) EQ "ftcombo">
						<CFSET isChecked="false">
						<TD style="padding-right:5px;" ALIGN="left" NOWRAP WIDTH="100">&nbsp;&nbsp;#COLUMNDESC#</TD><TD ><CFIF COLUMNREQUIRED EQ "Y">&nbsp;*&nbsp;</CFIF></TD>
						<TD NOWRAP>
						<CFIF ListLen(PICKLIST) LTE 3>
							<CFLOOP INDEX="x" LIST="#PICKLIST#">
								<INPUT NAME="edt#COLUMNNAME#" <CFIF Trim(x) EQ Trim(sEntryValue)>CHECKED</CFIF> TYPE="radio" VALUE="#Trim(x)#" #btnDisable#>#x#
							</CFLOOP>
						</TD>
						<CFELSE>
								<CFSET lstParam = "">
								<SELECT NAME="edt#COLUMNNAME#" SIZE="1" #btnDisable#>
									<OPTION VALUE="">&nbsp;&nbsp;</OPTION>
									<CFLOOP INDEX="ListElement" LIST="#PICKLIST#" DELIMITERS=",">
										<CFIF #sEntryValue# EQ #ListElement#>
											<OPTION SELECTED VALUE="#ListElement#">#ListElement#</OPTION>
										<CFELSE>
											<OPTION VALUE="#ListElement#">#ListElement#</OPTION>
										</CFIF>
									</CFLOOP>
								</SELECT>
							</TD>
						</CFIF>
					<CFELSE>
						<CFQUERY NAME="GetLookup" DATASOURCE="#client.global_dsn#">
							SELECT A.*, B.LEVELID
							FROM GSTLOOKUP A, GRGBOSETABLE B
							WHERE
								(A.MASTERTABLE = '#GetData.TABLENAME_FK#') AND
								(A.MASTERFIELD = '#COLUMNNAME#') AND
								(A.LOOKUPTABLE = B.TABLENAME)
								</CFQUERY>
						<CFIF GetLookup.RecordCount>
							<CFMODULE TEMPLATE="#client.common_path#cfm_leveldsn.cfm" DBLEVEL="#GetLookup.LEVELID#"> 
							<CFQUERY NAME="qryDesc" DATASOURCE="#DSN#">
								SELECT #GetLookup.LOOKUPRESULTFIELD# AS DESCVALUE
								FROM #GetLookup.LOOKUPTABLE#
								WHERE #GetLookup.LOOKUPKEYFIELD# = '#sEntryValue#'
							</CFQUERY>
							<CFIF (GetLookup.FILTERSYMBOL NEQ "[null]" AND Trim(GetLookup.FILTERSYMBOL) NEQ "")>
								<CFSET sfldFilter="#GetLookup.FILTERFIELD#" & "#GetLookup.FILTERSYMBOL#">
								<CFSET sfldVal="#GetLookup.FILTERVALUE#">
							</CFIF>
							<CFIF (GetLookup.FILTERSYMBOL2 NEQ "[null]" AND Trim(GetLookup.FILTERSYMBOL2) NEQ "")>
								<CFSET sfldFilter= sfldFilter & ",#GetLookup.FILTERFIELD2#" & "#GetLookup.FILTERSYMBOL2#">
								<CFSET sfldVal= sfldVal & ",#GetLookup.FILTERVALUE2#">
							</CFIF>
							<CFIF (GetLookup.FILTERSYMBOL3 NEQ "[null]" AND Trim(GetLookup.FILTERSYMBOL3) NEQ "")>
								<CFSET sfldFilter= sfldFilter & ",#GetLookup.FILTERFIELD3#" & "#GetLookup.FILTERSYMBOL3#">
								<CFSET sfldVal= sfldVal & ",#GetLookup.FILTERVALUE3#">
							</CFIF>
							<CFMODULE TEMPLATE="#client.common_path#cfm_htmlobject.cfm"
								TYPE="LOOKUP" ALIGN="LEFT"
								HTMLNAME="edt#COLUMNNAME#" VALUE="#sEntryValue#"
								DESCRIPTION="&nbsp;&nbsp;#COLUMNDESC#"
								REQUIRED="#isRequired#"
								WITHFIELDDESC="true" WITHAUDITFIELD="true"
								READONLY="#isReadonly#" HINT="#HINT#"
								PARAMETERS="#qryDesc.DESCVALUE#|javascript:ShowLookup('#GetLookup.LEVELID#','#GetLookup.LOOKUPTABLE#','edt#COLUMNNAME#','frmBatchApp',
								'#GetLookup.LOOKUPKEYFIELD#~#GetLookup.LOOKUPKEYFIELD#~ftString,#GetLookup.LOOKUPRESULTFIELD#~#GetLookup.LOOKUPRESULTFIELD#~ftString,'
								,'#GetLookup.LOOKUPKEYFIELD#','edt#COLUMNNAME#Desc','#GetLookup.LOOKUPRESULTFIELD#','#sfldFilter#','#sfldVal#')">
						<CFELSE>
							<CFIF DISPLAYFORMAT NEQ "">
								<CFMODULE TEMPLATE="#client.common_path#cfm_htmlobject.cfm"
									TYPE="TEXT"  ALIGN="LEFT"
									HTMLNAME="edt#COLUMNNAME#" VALUE="#sEntryValue#"
									DESCRIPTION="&nbsp;&nbsp;#COLUMNDESC#" MAXLENGTH = "#PHYSICALWIDTH#"
									REQUIRED="#isRequired#"  SIZE ="#BOSESIZE#"
									WITHFIELDDESC="true" WITHAUDITFIELD="true"
									READONLY="#isReadonly#" HINT="#HINT#"
									PARAMETERS2 = "onBlur=""javascript: validateMasked(this,'#GetFields.DISPLAYFORMAT#')""" WIDTH4 = "150">
							<CFELSE>
								<CFMODULE TEMPLATE="#client.common_path#cfm_htmlobject.cfm"
									TYPE="TEXT"  ALIGN="LEFT"
									HTMLNAME="edt#COLUMNNAME#" VALUE="#sEntryValue#"
									DESCRIPTION="&nbsp;&nbsp;#COLUMNDESC#" MAXLENGTH = "#PHYSICALWIDTH#"
									REQUIRED="#isRequired#"  SIZE ="#BOSESIZE#"
									WITHFIELDDESC="true" WITHAUDITFIELD="true"
									READONLY="#isReadonly#" HINT="#HINT#"
									WIDTH4 = "150">
							</CFIF>
						</CFIF>
					</CFIF>
				<CFELSEIF ListFindNoCase(GetData.FLDDATES,COLUMNNAME) NEQ 0 AND isDefined("url.employeeid")>
					<CFMODULE TEMPLATE="#client.common_path#cfm_htmlobject.cfm"
						TYPE="DATE" ALIGN="LEFT"
						HTMLNAME="edt#COLUMNNAME#" VALUE="#sEntryValue#"
						DESCRIPTION="&nbsp;&nbsp;#COLUMNDESC#"
						REQUIRED="#isRequired#"
						WITHFIELDDESC="true" WITHAUDITFIELD="true"
						READONLY="#isReadonly#" HINT="#HINT#"
						PARAMETERS="frmBatchApp|">
				<CFELSE>
					<TD style="padding-right:5px;" ALIGN="left" NOWRAP WIDTH="150">&nbsp;&nbsp;#COLUMNDESC#</TD><TD><CFIF COLUMNREQUIRED EQ "Y">&nbsp;*&nbsp;</CFIF></TD>
						<TD NOWRAP><INPUT TYPE="TEXT" SIZE="#BOSESIZE#" READONLY><i>&nbsp;uneditable field</i></TD>
				</CFIF>
				</TR>
			</CFLOOP>
		</CFOUTPUT>
	</TABLE>
	<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TOP="False">
